02. Architecture Style

JAVA C2 L2 02 REST Architecture Style

REST stands for REpresentational State Transfer. It’s a set of guidelines application developers use to design APIs.

There are four principles that APIs follow:

  1. Data and functionality in the API are considered “resources” and identified through something called the URI, or Uniform Resource Identifier. These are accessed by web links.
  2. Resources are manipulated using a fixed set of operations. GET retrieves a resource. POST creates one. Use PUT to update the resource, and of course, DELETE will remove it.
  3. Resources can be represented in multiple formats, such as HTML, XML, plain text, and other formats defined by a media type.
  4. Communication between the client and server (i.e. endpoint) is stateless. This means the server will not remember or store any state about the client that made the call.

Identify TWO principles that REST APIs must follow.

SOLUTION:
  • Resources are manipulated through a fixed set of operations.
  • Resources are identified through a URI and are accessible via web links.